/**
 * ActionEraseObject
 *
 * @created Mar 1, 2007
 * @author jprieur
 *
 */
package mygui;

import java.awt.event.*;
import javax.swing.*;

import kernel.Simulator;

public class ActionEraseObject extends AbstractAction
{

    MonIHM _gui;

    public ActionEraseObject(MonIHM gui)
    {
	_gui = gui;
	putValue(AbstractAction.NAME, "Eraser");
	putValue(AbstractAction.SHORT_DESCRIPTION, 
		 "Erase objects from the edition area");
	putValue(AbstractAction.ACCELERATOR_KEY,
		 KeyStroke.getKeyStroke(KeyEvent.VK_D, KeyEvent.CTRL_MASK));
	putValue(AbstractAction.SMALL_ICON,
		 UIM.createImageIcon("images/eraser.png","Erase objects"));
    }

    public void actionPerformed(ActionEvent e)
    {
	_gui.leaveModes();
	_gui.getAffichage().setMode(DisplayPanel.Mode.ERASER);
    }

}